import random


class RandomIterable:
    def __iter__(self):
        return self

    def next(self):
        if random.choice(["go", "go", "stop"]) == "stop":
            raise StopIteration  # signals "the end"
        return 1


if __name__ == '__main__':
    re=RandomIterable()
    print(re.next())